<?php
/**
 * Ecma-262 5rd 7.2
 *
 */
class WhiteSpace extends InputElement {
    
    // 规范里还定义了一种 Any other Unicode 'space separator',参考Ecma-262 5rd 7.2
    public static $WhiteSpaceList = array(
        '0x9',      // <TAB>
        '0xB',      // <Vertical Tab>
        '0xC',      // <Form Feed>
        '0x20',     // <Space>
        '\u00A0',   // <No-break space>
        '\uFEFF',   // <Byte Order Mark>
    );
    
    public function __construct() {
        parent::__construct ();
        $this->inputElementType = InputElement::WhiteSpace;
    }
    
    /**
     * 参考Ecma-262 5rd 7.2 , 暂不支持\u00A0 \uFEFF
     * 
     */
    public static function isWhiteSpace($char){
        $charCode = ord($char);
        if($charCode == 0x9 || $charCode == 0xB || $charCode == 0xC || $charCode == 0x20){
            return true;
        }
        else{
            return false;
        }
    }
}